1. Field of the Invention
The present invention relates generally to computer operating systems and, more particularly, to techniques for template-based creation and archival of file systems.
2. Description of the Background Art
With the popularity and success of the Internet, server technologies are of great commercial importance today. An individual server application typically executes on a single physical host computer, servicing client requests. However, providing a unique physical host for each server application is expensive and inefficient.
For example, commercial hosting services are often provided by an Internet Service Provider (ISP), which generally provides a separate physical host computer for each customer on which to execute a server application. However, a customer purchasing hosting services will often neither require nor be amenable to paying for use of an entire host computer. In general, an individual customer will only require a fraction of the processing power, storage, and other resources of a host computer.
Accordingly, hosting multiple server applications on a single physical computer would be desirable. In order to be commercially viable, however, every server application would need to be isolated from every other server application running on the same physical host. Clearly, it would be unacceptable to customers of an ISP to purchase hosting services, only to have another server application program (perhaps belonging to a competitor) access the customer""s data and client requests. Thus, each server application program needs to be isolated, receiving requests only from its own clients, transmitting data only to its own clients, and being prevented from accessing data associated with other server applications.
Furthermore, it is desirable to allocate varying specific levels of system resources to different server applications, depending upon the needs of, and amounts paid by, the various customers of the ISP. In effect, each server application needs to be a xe2x80x9cvirtual private server,xe2x80x9d simulating a server application executing on a dedicated physical host computer.
Such functionality is unavailable on traditional server technology because, rather than comprising a single, discrete process, a virtual private server must include a plurality of seemingly unrelated processes, each performing various elements of the sum total of the functionality required by the customer. Because each virtual private server includes a plurality of processes, it has been impossible using traditional server technology for an ISP to isolate the processes associated with one virtual private server from those processes associated with other virtual private servers.
Another difficulty in implementing multiple virtual private servers within a single physical host involves providing each server with a separate file system. A file system is an organized accumulation of data within one or more physical.storage devices, such as a hard disk drive or RAID (redundant array of inexpensive disks). The data is typically organized into xe2x80x9cfiles,xe2x80x9d such as word processing documents, spreadsheets, executable programs, and the like. The files are stored within a plurality of xe2x80x9cstorage unitsxe2x80x9d of the storage device, sometimes referred to as xe2x80x9cdisk blocksxe2x80x9d or xe2x80x9callocation units.xe2x80x9d
Unfortunately, providing a separate physical device for storing the file system of each virtual private server would be expensive and inefficient. Accordingly, it would be desirable to store the file systems of multiple virtual private servers within the same physical device or comparatively small set of devices.
ServerXchange(copyright), a product of Ensim Corporation, provides multiple virtual processes, such as virtual private servers, with separate file systems. Each file system is stored in a linear set of equal-sized storage units within the same physical storage device.
This approach still presents a number of difficulties, however. For example, an initial file system, including standard applications, utilities, databases, etc., must be duplicated for each virtual private server. Such a duplication process results in copying large amounts of data from one disk location to another, consuming significant amounts of time and placing substantial memory and disk load on the physical server. Such extensive duplication also results in wasted storage space, since all or part of the resulting file systems are identical.
The above approach also presents difficulties when archiving (e.g., backing up) the file systems. For example, since the file systems are being constantly changed by activity within the virtual private servers, it is impossible to obtain a backup that is a xe2x80x9csnapshotxe2x80x9d of the files systems at a particular time. By the time the backup process is complete (which may take several hours), the file systems will have changed substantially. In addition, backing up such file systems may result in a substantial waste of time and storage space due to the archival of duplicate data for each file system.
Accordingly, what is needed is a technique for creating separate file systems for a plurality of virtual private servers that does not require extensive copying or wasted storage space. What is also needed is a technique for efficiently backing up a file system of a virtual private server in which a snapshot of the file system may be obtained at a particular point in time.
The present invention relates to systems and methods for file system creation and archival. In one embodiment, first and second sets of storage units are provided, each storage unit of the first set corresponding to a storage unit of the second set. The sets of storage units may be contained within a single storage device or within a comparatively small set of devices.
In addition, a usage map is provided for indicating which storage units of the second set contain valid data. The usage map is initially reset or xe2x80x9cinitializedxe2x80x9d to indicate that none of the storage units of the second set contain valid data.
An attempt to write a data item to a storage unit of the first set is then intercepted. Rather than writing the data item to the storage unit of the first set, however, the data item is written to the corresponding storage unit of the second set. Thereafter, an indication is stored in the usage map that the corresponding storage unit of the second set contains valid data.
Additionally, an attempt to read a data item from a storage unit of the first set is intercepted. If the usage map indicates that the corresponding storage unit of the second set contains valid data, the data item is read from the corresponding storage unit of the second set. If, however, the usage map indicates that the corresponding storage unit of the second set does not contain valid data, the data item is read from the specified storage unit of the first set.
Each set of private storage units and corresponding usage map are referred to herein as a xe2x80x9ctemplate.xe2x80x9d In accordance with the present invention, file systems are represented as xe2x80x9cstacksxe2x80x9d of templates, in which all data is written to an xe2x80x9cactivexe2x80x9d template at the xe2x80x9ctopxe2x80x9d of the stack, and all data is read from the topmost template in the stack for which an indication of valid data is found in the corresponding usage map.
Private storage units of a template that is not currently the active template may be backed up to a storage device in order to obtain a xe2x80x9csnapshotxe2x80x9d of the changes to an initial file system at a particular point in time.